class Person:

    def __init__(self,name,age):
        self.name = name
        self.__age = age

    def __str__(self):
        return "名字：{},年龄：{}".format(self.name,self.__age)

    def __add__(self,other):
        if isinstance(other,Person):
            return self.name + other.name

        else:
            print("不是同类对象，不能相加")

p = Person('tom',18)
p1 = Person('lucy',16)

x = p + p1
print(x)